package au.edu.swin.videoshop.bean;

import java.io.Serializable;

public class Address implements Serializable{
	private String mAddressLine;
	private String mSuburb;
	private String mPostcode;
	private AddressState mState;
	
	public Address() {
		
	}
	
	/**
	 * @param addressLine
	 * @param suburb
	 * @param postcode
	 * @param state
	 */
	public Address(String addressLine, String suburb, String postcode, AddressState state) {
		mAddressLine = addressLine;
		mSuburb = suburb;
		mPostcode = postcode;
		mState = state;
	}
	
	/**
	 * @return the addressLine
	 */
	public String getAddressLine() {
		return mAddressLine;
	}
	
	/**
	 * @param addressLine the addressLine to set
	 */
	public void setAddressLine(String addressLine) {
		mAddressLine = addressLine;
	}
	
	/**
	 * @return the suburb
	 */
	public String getSuburb() {
		return mSuburb;
	}
	
	/**
	 * @param suburb the suburb to set
	 */
	public void setSuburb(String suburb) {
		mSuburb = suburb;
	}
	
	/**
	 * @return the postcode
	 */
	public String getPostcode() {
		return mPostcode;
	}
	/**
	 * @param postcode the postcode to set
	 */
	public void setPostcode(String postcode) {
		mPostcode = postcode;
	}

	/**
	 * @return the state
	 */
	public AddressState getState() {
		return mState;
	}

	/**
	 * @param state the state to set
	 */
	public void setState(AddressState state) {
		mState = state;
	}
	
	/**
	 * @return the state
	 */
	public String getStateString() {
		if (mState != null) {
			return mState.getName();
		}
		else {
			return null;
		}
	}

	/**
	 * @param state the state to set
	 */
	public void setStateString(String state) {
		mState = AddressState.getInstance(state);
	}
}
